package com.ziven.common.widget.title;

import android.view.View;

import androidx.annotation.NonNull;

import com.ziven.common.widget.R;
import com.ziven.common.widget.value.Background;
import com.ziven.common.widget.value.Listener;
import com.ziven.common.widget.value.TakeEffect;
import com.ziven.common.widget.value.Value;

/**
 * @author Ziven
 */
public interface SearchEffect extends BaseEffect<SearchView> {

    /**
     * Obtain Value
     * @return Value
     */
    @NonNull
    @Override
    default Value obtainValue() {
        return TakeEffect.values(
                Background.colorId(R.color.common_background_color),
                Listener.listener((View.OnClickListener) v -> obtainActivityBack().run())
                        .accept(my -> my.viewId = R.id.search_view_back)
        );
    }
}
